﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WindowsPhone.Tools
{
    public class FileOpration
    {
        static public string GetFileNameExtFromPath(string filePath)
        {
            string[] temp = filePath.Split('\\');
            return temp[temp.Length - 1];
        }

        static public string GetFileNameFromPath(string filePath)
        {
            string[] temp_array = GetFileNameExtFromPath(filePath).Split('.');
            string temp="";
            for (int i = 0; i < temp_array.Length - 1; i++)
            {
                temp += temp_array[i];
            }
            return temp;
        }

        static public string GetFileExtFromPath(string filePath)
        {
            string[] temp=GetFileNameExtFromPath(filePath).Split('.');
            return temp[temp.Length - 1];
        }

        static public bool IsXapFile(string filePath)
        {
            if (GetFileExtFromPath(filePath) == "xap")
            {
                return true;
            }
            return false;
        }
    }
}
